package com.mjl.shops.activity;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.mjl.shops.R;
import com.mjl.shops.adapter.ConvertAdapter;
import com.mjl.shops.base.BaseActivity;
import com.mjl.shops.base.BaseDate;
import com.mjl.shops.bean.ConvertBean;
import com.mjl.shops.utils.CommUtils;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ConvertActivity extends BaseActivity {

    private List<ConvertBean> convertBeans = new ArrayList<>();

    private ConvertAdapter adapter;

    @BindView(R.id.title_text_tv)
    TextView title_text_tv;

    @BindView(R.id.convert_recycler)
    RecyclerView convert_recycler;

    @Override
    protected void setContentViewBefore() {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
    }

    @Override
    protected int getViews() {
        return R.layout.activity_convert;
    }

    @Override
    protected void setViews() {
        ButterKnife.bind(this);
        title_text_tv.setText(getResources().getString(R.string.convert_list));
    }

    @Override
    protected void setDate() {
        convertBeans.addAll(BaseDate.getConversList());
        adapter = new ConvertAdapter(R.layout.item_convert_layout,convertBeans);
        convert_recycler.setLayoutManager(new LinearLayoutManager(this));
        convert_recycler.setAdapter(adapter);
    }

    @Override
    protected String getStateColor() {
        return CommUtils.color_05000000;
    }

    @Override
    protected int getStetaBackgroundStyle() {
        return 1;
    }

    @OnClick({R.id.icon_back})
    public void OnClick(View view){
        switch (view.getId()){
            case R.id.icon_back:
                finish();
                break;
        }
    }

    public static void StartIntent(Context contexts){
        Intent intent = new Intent(contexts,ConvertActivity.class);
        contexts.startActivity(intent);
    }
}
